from selenium.webdriver.common.by import By
from UI_web_wms.bayue.config.config import Config

class Page(Config):
    # 搜索框输入文字
    ssk_loc=(By.XPATH,'/html/body/div[1]/div[2]/div[4]/form/span[1]/input')
    def ssk(self):
        self.send_keys(self.ssk_loc,'自动化测试')
    # 按钮
    anniu_loc=(By.XPATH,'/html/body/div[1]/div[2]/div[4]/form/span[2]/input')
    def anniu(self):
        self.click(self.anniu_loc)
    # 标题


    # 翻到第二页
    fy_loc=(By.XPATH,'/html/body/div[3]/div[4]/div/a[1]')
    def fy(self):
        self.click(self.fy_loc)
    # 标题
    bt2_loc=(By.XPATH,'/html/body/div[3]/div[2]/div[1]/div[2]/div')
    # bt3_loc=(By.XPATH,'/html/body/div[3]/div[2]/div[1]/div[2]/div/div[2]/h3/a')


    def bt2(self):
        return self.find_elements(self.bt2_loc)

    def luoji(self):
        self.open_url('https://www.sogou.com/')
        self.ssk()
        self.anniu()
        self.fy()
        aa=self.bt2()
        for i in aa:
            print(i.text)

